#include "selecthall.h"
#include<QIcon>
#include<QPushButton>
#include"gamehall.h"
#include<QPainter>
#include"beginhall.h"
SelectHall::SelectHall(QWidget *parent) : QWidget(parent)
{
    this->setFixedSize(1000,800);
    this->setWindowIcon(QIcon(":rec/sheng.png"));
    this->setWindowTitle("游戏选择");
    QPushButton*back_button = new QPushButton(this);
    back_button->move(900,750);
    back_button->setIcon(QIcon(":rec/back.png"));
    connect(back_button,&QPushButton::clicked,this,&SelectHall::back_headle);
    QPushButton*eseay_button = new QPushButton(this);
    eseay_button->move(420,160);
    eseay_button->setText("简单模式");
    eseay_button->setFont(QFont("宋体",24));
    BeginHall*beginhall = new BeginHall;
    connect(eseay_button,&QPushButton::clicked,[=](){
        this->close();
        beginhall->show();

    });

    QPushButton*normal_button = new QPushButton(this);
    normal_button->setText("正常模式");
    normal_button->move(420,230);
    normal_button->setFont(QFont("宋体",24));
    connect(normal_button,&QPushButton::clicked,[=](){
        this->close();
        beginhall->show();

    });


    QPushButton*difficult_button = new QPushButton(this);
    difficult_button->setText("困难模式");
    difficult_button->setFont(QFont("宋体",24));
    difficult_button->move(420,300);
    connect(difficult_button,&QPushButton::clicked,[=](){
        this->close();
        beginhall->show();

    });


    QPushButton*history_button = new QPushButton(this);
    history_button->setText("历史最高记录");
    history_button->setFont(QFont("宋体",24));
    history_button->move(420,370);
    connect(history_button,&QPushButton::clicked,[=](){
        this->close();
        beginhall->show();

    });

}

void SelectHall::back_headle()
{
    GameHall*gamehall = new GameHall;
    this->close();
    gamehall->show();

}

void SelectHall::paintEvent(QPaintEvent *event)
{
    QPainter*painter = new QPainter(this);
    QPixmap pixmap(":rec/background.jpg");
    painter->drawPixmap(0,0,this->width(),this->height(),pixmap);

}
